package com.java.cloud.controller;

import com.github.pagehelper.PageInfo;
import com.java.cloud.service.SysMachineService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName: SysMachine
 * @Description:  终端设备管理
 * @Version: v1.0.0
 * @Author: Fu Hao
 * @Date: 2019/10/16 0016 下午 3:35
 * Modification History:
 * Date           Author      Version     Description
 * -------------------------------------------------------------
 * 2019/10/16 0016        Fu Hao      v1.0.0         创建
 */
@Controller
@RequestMapping("/sysmachine")
public class SysMachine {

    @Autowired
    private SysMachineService sysMachine;


    /**
       * No such property: code for class: Script1 description
       * @return  null
       * @Description  设备查询
       * @author Fu Hao on 2019/10/16 0016 下午 3:47
    */
    @ApiOperation(value = "终端设备分页展示")
    @RequestMapping("/selectSysMachine")
    @ResponseBody
    public List<SysMachine> selectSysMachine(Integer page, Integer size){
        page=(page==null?1:page);
        size=(size==null?1:size);
        List<SysMachine> list=sysMachine.selectSysMachine(page,size);
        PageInfo<SysMachine> pageInfo=new PageInfo<>(list);
        System.out.println(pageInfo);
        System.out.println("查询成功");
        return (List<SysMachine>) pageInfo;

    }
}
